package com.elminster.common.db.analyze;

import java.lang.reflect.Method;
import java.util.List;

/**
 * An analyzer for parser SQL statement.
 * 
 * @author Gu
 * @version 1.0
 * 
 */
public interface ISqlAnalyzer {
	
	/**
	 * SQL statement type
	 * 
	 * @author Gu
	 * @version 1.0
	 *
	 */
	public enum SqlType {
		QUERY,
		UPDATE,
		STORED_PROCEDURE
	}

	/**
	 * Parser a SQL statement to get the SQL statement and the SQL statement's parameter(s).
	 * @param method the method which original SQL statement is invoked
	 * @param methodArguments the method's argument(s)
	 */
	public void parser(Method invokedMethod, Object... methodArguments);

	/**
	 * Get the analyzed SQL statement.
	 * @return the analyzed SQL statement
	 */
	public String getAnalyzedSql();
	
	/**
	 * Get the analyzed SQL statement's parameter(s).
	 * @return the analyzed SQL statement's parameter(s)
	 */
	public List<Object> getAnalyzedSqlParameters();
	
	/**
	 * Get SQL statement type.
	 * @return SQL statement type
	 */
	public SqlType getSqlType();
}
